
#ifndef LCD_TOUCH_DRV_H
#define LCD_TOUCH_DRV_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
        INCLUDES
 *********************/
#include <stdint.h>
#include <stdbool.h>
#include <lvgl.h>

/*********************
        DEFINES
 *********************/
//"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"
#define DISP_ORIENTATION     2
#define DISP_HOR_RES       320
#define DISP_VER_RES       240
#define DISP_BUF_SIZE    (DISP_HOR_RES * 10)

#define DRV_SPI_MOSI        23
#define DRV_SPI_MISO        19
#define DRV_SPI_CLK         18

//#define ILI9341_BCKL      22
#define ILI9341_DC          2
#define ILI9341_RST         4
#define DISP_SPI_CS         5
#define XPT2046_IRQ         22
#define TP_SPI_CS           15

#define XPT2046_AVG         4
#define XPT2046_X_MIN       500
#define XPT2046_Y_MIN       500
#define XPT2046_X_MAX       3800
#define XPT2046_Y_MAX       3800
#define XPT2046_X_INV       1
#define XPT2046_Y_INV       1

typedef void (*drv_log_t)(const char *, uint32_t);
void lcd_touch_drv_log_cb(drv_log_t print_cb);

void ili9341_sleep_in();
void ili9341_sleep_out();
void lcd_touch_drv_init(void);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*LCD_TOUCH_DRV_H*/
